package com.disease.chronic.Mappers;

import com.disease.chronic.pojo.Family;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface FamilyMapper {
    int deleteByPrimaryKey(String familyName);

    int insert(Family record);

    int insertSelective(Family record);

    Family selectByPrimaryKey(String phoneNumber);

    @Select("SELECT FAMILYNAME, PHONENUMBER FROM \"FAMILY\" WHERE USERNAME = #{username}")
    @Results({
            @Result(column = "FAMILYNAME", property = "familyName"),
            @Result(column = "PHONENUMBER", property = "phoneNumber")
    })
    List<Family> selectByUsername(String username);

    int updateByPrimaryKeySelective(Family record);

    int updateByPrimaryKey(Family record);
}
